using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMoveState : PlayerGroundState
{
    public PlayerMoveState(Player playerBase, PlayerStateMachine playerStateMachine, string animBoolName) : base(playerBase, playerStateMachine, animBoolName)
    { 
    }

    public override void Enter()
    {
        base.Enter();
        AudioManager.Instance.PlayClip(1, null);
    }

    public override void Exit()
    {
        base.Exit();
        AudioManager.Instance.StopClip(1);
    }

    public override void Update()
    {
        base.Update();
        player.SetVelocity(xInput* player.moveSpeed, player.rigid.velocity.y);
        if (xInput == 0||player.IsWall())
        {
            playerStateMachine.ChangeState(player.playerIdleState);
        }
    }
}
